package com.example.taximeter.bean;

import com.alibaba.fastjson.annotation.JSONField;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.sql.Blob;
import java.util.Date;

/**
 * 参数文件
 */
public class ParamFile {

    @Valid
    @NotNull(message = "参数文件id格式错误", groups =  GroupUpdate.class)
    private String id;//参数文件id--主键

    @Valid
    @NotNull(message = "计价器厂家id格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Integer factid;//计价器厂家id--外键

    @Valid
    @NotNull(message = "计价器型号id格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Integer jjqtypeid;//计价器型号id--外键

    @NotNull(message = "价格类别id格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Integer priceid;//价格类别id--外键

    @NotNull(message = "升级文件版本号格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    @NotEmpty(message = "升级文件版本号不能为空", groups = {GroupCreate.class, GroupUpdate.class})
    @Length(min = 0, max = 50, message = "升级文件版本号格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String version;//升级文件版本号

    @NotNull(message = "物价文件编号格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    @NotEmpty(message = "物价文件编号不能为空", groups = {GroupCreate.class, GroupUpdate.class})
    @Length(min = 0, max = 50, message = "物价文件编号格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String pricefileno;//物价文件编号

    @NotNull(message = "升级文件名称格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    @NotEmpty(message = "升级文件名称不能为空", groups = {GroupCreate.class, GroupUpdate.class})
    @Length(min = 0, max = 50, message = "升级文件名称格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String filename;//升级文件名称

    @Valid
    @NotNull(message = "升级文件内容格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Blob fileinfo;//升级文件内容

    @Valid
    @NotNull(message = "最新版本标记格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Integer newbj;//最新版本标记

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date stime;//录入时间

    @Valid
    @NotNull(message = "交通局审核标记格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Boolean trafficcheck;//交通局审核标记

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date traffictime;//交通局审核时间

    @Valid
    @NotNull(message = "物价局审核标记格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Boolean pricecheck;//物价局审核标记

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date pricetime;//物价局审核时间

    @Valid
    @NotNull(message = "计量局审核标记格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private Boolean metrologycheck;//计量局审核标记

    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date metrologytime;//计量局审核时间

    @Valid
    @NotNull(message = "文件id格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String fileid;//文件id

    @NotNull(message = "录入用户格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    @NotEmpty(message = "录入用户不能为空", groups = {GroupCreate.class, GroupUpdate.class})
    @Length(min = 1, max = 20, message = "录入用户格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String writeuser;//录入用户


    @Length(min = 0, max = 100, message = "备注格式错误", groups = {GroupCreate.class, GroupUpdate.class})
    private String memo;//备注

    @Override
    public String toString() {
        return "ParamFile{" +
                "id='" + id + '\'' +
                ", factid=" + factid +
                ", jjqtypeid=" + jjqtypeid +
                ", priceid=" + priceid +
                ", version='" + version + '\'' +
                ", pricefileno='" + pricefileno + '\'' +
                ", filename='" + filename + '\'' +
                ", fileinfo=" + fileinfo +
                ", newbj=" + newbj +
                ", stime=" + stime +
                ", trafficcheck=" + trafficcheck +
                ", traffictime=" + traffictime +
                ", pricecheck=" + pricecheck +
                ", pricetime=" + pricetime +
                ", metrologycheck=" + metrologycheck +
                ", metrologytime=" + metrologytime +
                ", fileid='" + fileid + '\'' +
                ", writeuser='" + writeuser + '\'' +
                ", memo='" + memo + '\'' +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getFactid() {
        return factid;
    }

    public void setFactid(Integer factid) {
        this.factid = factid;
    }

    public Integer getJjqtypeid() {
        return jjqtypeid;
    }

    public void setJjqtypeid(Integer jjqtypeid) {
        this.jjqtypeid = jjqtypeid;
    }

    public Integer getPriceid() {
        return priceid;
    }

    public void setPriceid(Integer priceid) {
        this.priceid = priceid;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getPricefileno() {
        return pricefileno;
    }

    public void setPricefileno(String pricefileno) {
        this.pricefileno = pricefileno;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public Blob getFileinfo() {
        return fileinfo;
    }

    public void setFileinfo(Blob fileinfo) {
        this.fileinfo = fileinfo;
    }

    public Integer getNewbj() {
        return newbj;
    }

    public void setNewbj(Integer newbj) {
        this.newbj = newbj;
    }

    public Date getStime() {
        return stime;
    }

    public void setStime(Date stime) {
        this.stime = stime;
    }

    public Date getTraffictime() {
        return traffictime;
    }

    public void setTraffictime(Date traffictime) {
        this.traffictime = traffictime;
    }

    public Date getPricetime() {
        return pricetime;
    }

    public void setPricetime(Date pricetime) {
        this.pricetime = pricetime;
    }

    public Date getMetrologytime() {
        return metrologytime;
    }

    public void setMetrologytime(Date metrologytime) {
        this.metrologytime = metrologytime;
    }

    public Boolean getTrafficcheck() {
        return trafficcheck;
    }

    public void setTrafficcheck(Boolean trafficcheck) {
        this.trafficcheck = trafficcheck;
    }

    public Boolean getPricecheck() {
        return pricecheck;
    }

    public void setPricecheck(Boolean pricecheck) {
        this.pricecheck = pricecheck;
    }

    public Boolean getMetrologycheck() {
        return metrologycheck;
    }

    public void setMetrologycheck(Boolean metrologycheck) {
        this.metrologycheck = metrologycheck;
    }

    public String getFileid() {
        return fileid;
    }

    public void setFileid(String fileid) {
        this.fileid = fileid;
    }

    public String getWriteuser() {
        return writeuser;
    }

    public void setWriteuser(String writeuser) {
        this.writeuser = writeuser;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }
}
